package cn.yunyichina.provider.hisiface.invoke.openservice;

import cn.yunyichina.provider.framework.dubbo.service.SbService;
import cn.yunyichina.provider.hisiface.invoke.IOutsideInvoke;
import cn.yunyichina.provider.iface.entity.common.Response;
import cn.yunyichina.utils.convert.JsonUtils;
import com.alibaba.fastjson.JSON;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.util.Map;

/**
 * Created by 15-AK on 2017/11/1.
 */
public class ReportSBInvoiceNoService implements IOutsideInvoke {

    private static final Logger logger = LoggerFactory.getLogger(ReportSBOutPatientService.class);

    @Override
    public String execute(Map<String, String> params) {
        String paramsStr = JSON.toJSONString(params);
        logger.info("openService:reportSBInvoiceNo 接收到前置机的入参: {}", paramsStr);
        String method = "yyt.sb.notify.invoice.no.report";
        Response response = SbService.callHumpFromInternal(method, paramsStr);
        String result = JsonUtils.toJsonString(response);
        logger.info("openService:reportSBInvoiceNo 接收到[{}]的返回: {}",method, result);
        logger.info("openService:reportSBInvoiceNo 返回给前置机: {}", result);

        return result;
    }
}
